<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015-08-26
 * Time: 21:34
 */
class b2c_ctl_wap_mymsg extends b2c_ctl_wap_common{
    function __construct(&$app){
        parent::__construct($app);
        $shopname = app::get('wap')->getConf('wap.name');
        $this->shopname =$shopname;
        if(isset($shopname)){
            $this->title = app::get('b2c')->_('樱淘社').$shopname;
            $this->keywords = app::get('b2c')->_('樱淘社').$shopname;
            $this->description = app::get('b2c')->_('樱淘社').$shopname;
        }
        $this->action = $this->_request->get_act_name();
        if(!$this->action) $this->action = 'index';
        $this->pagedata['res_url'] = $this->app->res_url;
        $this->userObject = kernel::single('b2c_user_object');
        /** end **/
    }

    function index(){
        $input['method'] = array("file"=>"mobileapi_rpc_mymessage","action"=>"mymsg");
        $res = $this->getApi($input);
        $this->pagedata['msg'] = $res['data'];
        $this->page('wap/mymsg/index.html');
    }

    function getcomment(){
        $input['method'] = array("file"=>"mobileapi_rpc_goods","action"=>"get_comment_for_member");
        $mid = $this->get_current_member();
        $input['data'] = array("member_id"=>$mid['member_id']);
        $res = $this->getApi($input);

        $this->pagedata['com'] = $res['data'];
        $this->page('wap/mymsg/comment.html');
    }

    function getpraise(){
        $input['method'] = array("file"=>"mobileapi_rpc_goods","action"=>"get_praise_for_member");
        $mid = $this->get_current_member();
        $input['data'] = array("member_id"=>$mid['member_id']);
        $res = $this->getApi($input);

        $this->pagedata['pas'] = $res['data'];
        $this->page('wap/mymsg/praise.html');
    }

    function getfans(){
        $input['method'] = array("file"=>"mobileapi_rpc_goods","action"=>"get_fans");
        $mid = $this->get_current_member();
        $input['data'] = array("member_id"=>$mid['member_id']);
        $res = $this->getApi($input);

        $this->pagedata['fans'] = $res['data'];
        $this->page('wap/mymsg/fans.html');
    }

    function getsysmsg(){
        $input['method'] = array("file"=>"mobileapi_rpc_mymessage","action"=>"mysysmsg");
        $res = $this->getApi($input);

        $this->pagedata['sys'] = $res['data'];
        $this->page('wap/mymsg/system.html');
    }
}